// 模拟数据 - 用于开发阶段测试
export const mockData = {
  // 模拟月度概览数据
  monthlyOverview: {
    totalExpense: 1250.50,
    totalIncome: 8000.00,
    balance: 6749.50
  },

  // 模拟最近记录
  recentRecords: [
    {
      id: 1,
      type: 'expense',
      amount: 25.50,
      category: '餐饮',
      note: '午餐',
      date: '2025-01-15'
    },
    {
      id: 2,
      type: 'expense',
      amount: 128.00,
      category: '购物',
      note: '超市采购',
      date: '2025-01-14'
    },
    {
      id: 3,
      type: 'income',
      amount: 8000.00,
      category: '工资',
      note: '1月工资',
      date: '2025-01-10'
    },
    {
      id: 4,
      type: 'expense',
      amount: 45.00,
      category: '交通',
      note: '地铁月卡',
      date: '2025-01-08'
    },
    {
      id: 5,
      type: 'expense',
      amount: 89.90,
      category: '娱乐',
      note: '电影票',
      date: '2025-01-05'
    }
  ],

  // 模拟分类统计
  categoryStats: [
    {
      categoryName: '餐饮',
      amount: 450.50,
      percentage: 36.0
    },
    {
      categoryName: '购物',
      amount: 320.00,
      percentage: 25.6
    },
    {
      categoryName: '交通',
      amount: 180.00,
      percentage: 14.4
    },
    {
      categoryName: '娱乐',
      amount: 150.00,
      percentage: 12.0
    },
    {
      categoryName: '其他',
      amount: 150.00,
      percentage: 12.0
    }
  ],

  // 模拟分类数据
  categories: {
    expense: [
      { id: 1, name: '餐饮', icon: '🍽️' },
      { id: 2, name: '购物', icon: '🛒' },
      { id: 3, name: '交通', icon: '🚇' },
      { id: 4, name: '娱乐', icon: '🎬' },
      { id: 5, name: '医疗', icon: '💊' },
      { id: 6, name: '教育', icon: '📚' },
      { id: 7, name: '住房', icon: '🏠' },
      { id: 8, name: '其他', icon: '📝' }
    ],
    income: [
      { id: 9, name: '工资', icon: '💰' },
      { id: 10, name: '奖金', icon: '🎁' },
      { id: 11, name: '投资', icon: '📈' },
      { id: 12, name: '兼职', icon: '💼' },
      { id: 13, name: '其他', icon: '📝' }
    ]
  }
};

// 模拟API响应
export const mockAPI = {
  // 模拟月度概览
  getMonthlyOverview: () => {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve(mockData.monthlyOverview);
      }, 500);
    });
  },

  // 模拟最近记录
  getRecentRecords: () => {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve(mockData.recentRecords);
      }, 500);
    });
  },

  // 模拟分类统计
  getCategoryStats: () => {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve(mockData.categoryStats);
      }, 500);
    });
  },

  // 模拟分类数据
  getCategories: (type) => {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve(mockData.categories[type] || []);
      }, 300);
    });
  }
};

// 使用说明
export const mockUsage = `
// 在开发阶段使用模拟数据：

// 1. 导入模拟数据
import { mockAPI } from '@/utils/mockData.js';

// 2. 替换真实API调用
// 原来的代码：
// const overview = await recordAPI.getOverview(startDate, endDate);

// 替换为：
// const overview = await mockAPI.getMonthlyOverview();

// 3. 生产环境时切换回真实API
`;
